<script>
function back(){
    window.location.href = <?php echo $_SERVER['HTTP_REFERER'] ?>;
}
</script>
<div style="text-align: center;">
<?php

/**
 * @author Martin Pernica
 * @copyright 2008
 */
if(!empty($_GET['id'])){
	Text::h1( Lang::getBack('com_custom', 'delete', array(intval($_GET['id']))) );
    
	echo '<form action="'.$_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'].'" method="POST"><br />';
	echo '<input type="submit" name="delete" value="'.Lang::getBack('com_custom', 'delete2').'" />&nbsp;&nbsp;&nbsp;<input type="button" value="'.Lang::getBackGlobal('back').'" onclick="javascript:back()" /></form>';
	if($_POST['delete'] == Lang::getBack('com_custom', 'delete2')){
$query = Registry::get('db')->query("DELETE FROM {prefix}custom WHERE id = '".intval($_GET['id'])."'");
		$log->write(8, 'com_custom', 'NOW()', 'User deleted page #'.intval($_GET['id']), $_SESSION['id']);
		messageBox( Lang::getBack('com_custom', 'deleted_done') );
		echo '<meta http-equiv="refresh" content="2;url=index.php?p=components&name=custom">';
    }
}
?>
</div>